package com.pj.fragment.fragment;

import android.os.Bundle;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.webkit.WebView;

import androidx.fragment.app.Fragment;

import com.pj.fragment.R;

public class WebFragment extends Fragment {

    private WebView webView;


    private String url;

    public WebFragment(String url) {
        this.url = url;
    }

    @Override
    public View onCreateView(LayoutInflater inflater, ViewGroup container,
                             Bundle savedInstanceState) {
        // Inflate the layout for this fragment
        View view = inflater.inflate(R.layout.fragment_web, container, false);
        initView(view);
        webView.loadUrl(url);
        return view;
    }

    private void initView(View view) {
        webView = (WebView) view.findViewById(R.id.web_view);
    }
}